<template>
	<view class="container">
		<view class="banner">
			<u-swiper :list="listArr" height="180" radius="20"></u-swiper>
		</view>
		<view class="mySearch">
			<view class="selectTop">
				<view class="item">
					<vvSelect placeholder="城市筛选" class="select" :list="city_list" label="name" valueKey="type_id"
						ref="vvSelect1" @change="pickerChange"></vvSelect>
					<view class="arrow">
						<u-icon name="arrow-down" color="#081738;" v-if="form.type_id == ''" size="16">
						</u-icon>
						<u-icon name="close-circle" color="#081738;" v-if="form.type_id" size="16" @click="closeSel1">
						</u-icon>
					</view>
				</view>
			</view>
			<view class="search">
				<!-- <u-search placeholder="请输入搜索内容" v-model="keyword"></u-search> -->
				<input type="search" name="" id="" class="topSearch" placeholder="搜索你需要的内容" v-model="form.search">
				<image src="../../static/searchRight.png" mode="" class="searchBtn" @click="List"></image>
			</view>
		</view>
		<view class="content-contact">
			<view class="leftCar">
				<view class="top">
					扫码洗车
				</view>
				<view class="bot">
					巨划算，马上洗车
				</view>
			</view>
			<view class="rightCars">
				<view class="treatCar">
					<view class="top">
						优惠洗车
					</view>
					<view class="bot">
						洗车超优惠
					</view>
					<view class="bot1">
						赶紧来～
					</view>
				</view>
				<view class="botCar">
					<view class="buy" @click="buyCard">
						<view class="top">
							购洗车卡
						</view>
						<view class="bot">
							限时优惠购卡
						</view>
					</view>
					<view class="share">
						<view class="top">
							好友分享
						</view>
						<view class="bot">
							邀请好友得
						</view>
						<view class="bot1">
							优惠
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="recommend f-column">
			<view class="title">
				精选推荐
			</view>
			<view class="list f-column" v-for="(item,index) in list" :key="index" @click="goDetails(item.id)">
				<view class="list_item" :style="{background:item.status==1?'#2CB9A4':'#fff'}">
					<view class="title" v-if="item.status == 1">
						今日推荐
					</view>
					<view class="content">
						<view class="item" @click="goCard(item)">
							<view class="icon">
								<image :src="item.icon" mode="" class="image"></image>
							</view>
							<view class="entityList">
								<view class="num" style="font-size: 32rpx;">
									{{item.name}}
								</view>
								<view class="name">
									<text>{{item.msg}}</text>
									<view class="right">
										<image src="../../static/icon/my/goIcon.png" mode="" class="image"></image>
										<text class="themeColor">{{item.gl}}km</text>
									</view>
								</view>
							</view>
						</view>
						<view class="conBot">
							<view class="f-row ">
								<view class="down">
									<view class="">
										团洗优
									</view>
									<view class="">
										惠价
									</view>
								</view>
								<view class="down_price">
									¥15.00
								</view>
								<view class="price">
									原价¥32.00
								</view>
							</view>
							<view class="f-row goNear">
								<image src="../../static/images/index/btnBg.png" mode="widthFix"
									style="width: 20rpx;height: 20rpx;margin-right: 10rpx;"></image>
									<view class="">
										前往洗车
									</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import vvSelect from '@/components/vv-select/vv-select.vue'
	export default {
		components: {
			vvSelect,
		},
		data() {
			return {
				list: [{
						name: '锦江店优惠洗车',
						msg: '锦成都市江区才华大街20号',
						id: 1,
						bh: 'ABCD65343434',
						gl: '9.9',
						status: 1,
						icon: '../../static/logo.png'
					},
					{
						name: '锦江店优惠洗车',
						msg: '锦成都市江区才华大街20号',
						id: 1,
						bh: 'ABCD65343434',
						gl: '20',
						status: 0,
						icon: '../../static/logo.png'
					}
				],
				listArr: [
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				],
				city_list: [{
					type_id: 1,
					name: '成都'
				}],
				form: {
					is_lx: "",
					subject_id: '',
					type_id: '',
					search: '',
					page: 1
				},

			}
		},
		onLoad() {
			// uni.navigateTo({
			// 	url:'/pages/login/wxLogin'
			// })
			// uni.navigateTo({
			// 	url:'/pages/login/login'
			// })
		},
		onShow() {

		},
		methods: {
			goDetails(e){
				uni.navigateTo({
					url: `/pages/index/productDetails`,
				})
			},
			buyCard() {
				uni.navigateTo({
					url: `/my_pages/cardLIst/cardLIst`,
				})
			},
			pickerChange(e) {
				this.form.type_id = e
			},
			closeSel1() {
				this.form.type_id = ''
				this.$refs.vvSelect1.emptCheckLabels()
				this.form.page = 1
				this.projectListData = []
				// this.projectList()
			},
		}
	}
</script>
<style scoped lang="scss">
	.recommend {
		padding: 0 20rpx;
		margin-top: 40rpx;

		.title {
			font-size: 30rpx;
			line-height: 20px;
			color: #222222;
			font-weight: 600;
		}

		.list {
			margin-top: 20rpx;

			.content {
				background-color: #fff;
				box-shadow: 0px 0px 10px rgba(8, 23, 56, 0.05);
				border-radius: 10px;
				padding: 20rpx;
				margin-top: 20rpx;

				.conBot {
					align-items: flex-end;
					.f-row {
						display: flex;
						align-items: flex-end;
					}
					.goNear {
						background: #2CB9A4;
						color: #fff;
						height: 60rpx;
						justify-content: center;
						align-items: center;
						border-radius: 10rpx;
						padding: 10rpx 20rpx;
						font-size: 32rpx;
						align-items: center;
					}
					display: flex;
					justify-content: space-between;
					color: #2CB9A4;

					.down {
						background: #C0EAE4;
						justify-content: center;
						display: flex;
						flex-direction: column;
						align-items: center;
						padding: 10rpx;
						font-size: 22rpx;
						border-radius: 10rpx;
						margin-right: 10rpx;
					}

					.down_price {
						margin-right: 10rpx;
					}

					.price {
						margin-right: 10rpx;
					}
				}
			}

			.list_item {
				display: flex;
				flex-direction: column;
				background: #2CB9A4;
				border-radius: 20rpx;
				padding: 20rpx;

				.title {
					color: #fff;
					font-size: 30rpx;
					font-weight: 600;
				}

				.item {
					display: flex;
					color: #505050;
					margin: 15rpx 0;
					border-bottom: 0.5px solid rgba(217, 217, 217, 0.3);
					padding-bottom: 15rpx;
					box-sizing: border-box;
					background: #fff;
					border-radius: 20rpx;

					.icon {
						width: 72rpx;
						height: 72rpx;
						width: 100rpx;
						height: 100rpx;

						.image {
							width: 100%;
							height: 100%;
						}
					}

					.entityList {
						flex: 1;
						display: flex;
						flex-direction: column;
						overflow: hidden;
						text-overflow: ellipsis;
						justify-content: space-between;

						.name {
							display: flex;
							justify-content: space-between;
							margin-left: 15rpx;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
							color: #BABABA;
							font-size: 36rpx;

							.image {
								width: 26rpx;
								height: 26rpx;
								margin-right: 10rpx;
							}
						}

						.num {
							margin-left: 15rpx;
							margin-top: 5rpx;
							color: #2CB9A4;
							font-size: 28rpx;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
						}
					}
				}
			}
		}
	}

	.content-contact {
		display: flex;
		justify-content: space-between;
		padding: 0 20rpx;

		.leftCar {
			background-size: 100% 100%;
			background-repeat: no-repeat;
			width: 49%;
			height: 510rpx;
			// background-color: #fff;
			border-radius: 20rpx;
			background-image: url(../../static/images/index/left1.png);

			.top {
				color: #000;
				font-weight: 600;
				font-size: 38rpx;
				padding-left: 40rpx;
				margin-top: 40rpx;
			}

			.bot {
				color: #BABABA;
				font-size: 28rpx;
				padding-left: 40rpx;
				margin-top: 20rpx;
			}

		}




		.rightCars {
			width: 49%;
			height: 510rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;

			.treatCar {
				// background-color: #fff;
				border-radius: 20rpx;
				height: 48%;
				// background-color: #fff;
				border-radius: 20rpx;
				background-image: url(../../static/images/index/right1.png);
				background-size: 100% 100%;
				background-repeat: no-repeat;

				.top {
					color: #000;
					font-weight: 600;
					font-size: 34rpx;
					padding-left: 40rpx;
					margin-top: 40rpx;
				}

				.bot {
					color: #BABABA;
					font-size: 28rpx;
					padding-left: 40rpx;
					margin-top: 20rpx;
				}

				.bot1 {
					color: #BABABA;
					font-size: 28rpx;
					padding-left: 40rpx;
					margin-top: 10rpx;
				}
			}

			.botCar {
				// background-color: #fff;
				border-radius: 20rpx;
				height: 48%;
				display: flex;
				justify-content: space-between;

				.buy {
					width: 48%;
					background: #fff;
					border-radius: 20rpx;
					background-image: url(../../static/images/index/right2.png);
					background-size: 100% 50%;
					background-repeat: no-repeat;
					background-position-y: bottom;
					background-position-x: right;
					background-size: 82%;

					.top {
						color: #000;
						font-weight: 600;
						font-size: 32rpx;
						text-align: center;
						margin-top: 20rpx;
					}

					.bot {
						color: #BABABA;
						font-size: 24rpx;
						text-align: center;
						margin-top: 20rpx;
					}
				}

				.share {
					width: 48%;
					background: #fff;
					border-radius: 20rpx;
					background-image: url(../../static/images/index/right3.png);
					background-size: 100% 50%;
					background-repeat: no-repeat;
					background-position-y: bottom;
					background-position-x: right;
					background-size: 82%;

					.top {
						color: #000;
						font-weight: 600;
						font-size: 32rpx;
						text-align: center;
						margin-top: 20rpx;
					}

					.bot {
						color: #BABABA;
						font-size: 24rpx;
						text-align: center;
						margin-top: 20rpx;
					}

					.bot1 {
						color: #BABABA;
						font-size: 24rpx;
						text-align: left;
						margin-top: 10rpx;
						padding-left: 27rpx;
					}
				}
			}
		}
	}

	.mySearch {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.search {
		position: relative;
		margin: 15rpx 0;
		padding: 0 20rpx;
		flex: 1;
	}

	.selectTop {
		width: 250rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 15rpx 0;
		margin-left: -20rpx;
		margin-right: -20rpx;
		padding: 20rpx 40rpx;
		// background: #fff;
		// border-bottom: 1px solid #E2E2E2;
		color: #081738;
		font-size: 24rpx;
		position: relative;

		.item {
			display: flex;
			width: 100%;
			background: rgba(255, 255, 255, 0.5);
			border-radius: 60px;
			padding: 15rpx;

			.select {
				flex: 1;
			}

			.arrow {
				width: 20rpx;
				height: 20rpx;
				margin-right: 8rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}
	}

	.topSearch {
		// border: 1px solid #ccc;
		border-radius: 80px;
		height: 70rpx;
		line-height: 70rpx;
		display: inherit;
		padding: 0 20rpx;
		color: #BABABA;
		padding-right: 80rpx;
		background: rgba(255, 255, 255, 0.5);
	}

	.searchBtn {
		position: absolute;
		height: 40rpx;
		width: 40rpx;
		right: 50rpx;
		top: 15rpx;
	}
</style>

<style>
	page {
		background: #f5f5f5;
	}

	view,
	textarea,
	input,
	text,
	button {
		padding: 0;
		margin: 0;
		box-sizing: border-box;
		font-size: 28rpx;
		font-family: "微软雅黑";
	}

	.uni-checkbox-input {
		border-radius: 50% !important;
	}

	.container {
		background: #f5f5f5;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
	}

	.line1 {
		overflow: hidden;
		text-overflow: ellipsis;
		display: box;
		display: -webkit-box;
		line-clamp: 1;
		box-orient: vertical;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		word-break: break-all;
		/* 英文换行问题 */
	}

	.line2 {
		overflow: hidden;
		text-overflow: ellipsis;
		display: box;
		display: -webkit-box;
		line-clamp: 2;
		box-orient: vertical;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		word-break: break-all;
		/* 英文换行问题 */
	}

	.centerboth {
		display: flex;
		display: -webkit-flex;
		align-items: center;
		-webkit-align-items: center;
		justify-content: center;
		-webkit-justify-content: center;
	}

	.clearfix:after {
		content: "";
		display: block;
		visibility: hidden;
		height: 0;
		clear: both;
	}

	.clearfix {
		zoom: 1;
	}

	image {
		padding: 0;
		margin: 0;
	}

	textarea {
		width: 300rpx;
		height: 75rpx;
		display: block;
		position: relative;
		font-size: 28rpx;
	}

	button::after {
		border: none;
	}

	input:-ms-input-placeholder {
		color: #808080;
	}

	.container {
		background: #F5F5F5;
	}

	.banner {
		width: 100%;
		padding: 0 24rpx;
		background-image: linear-gradient(to bottom, #2CB9A4, transparent);
	}

	.sideslip-car {
		width: 100%;
	}
</style>